package com.atguigu.rabbitmq.springbootrabbitmq.consumer;

import com.atguigu.rabbitmq.springbootrabbitmq.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author gan
 * @create 2021-7-26 22:33
 */
@Slf4j
@Component
public class BackUpConsumer {

    //接收报警消息
    @RabbitListener(queues = ConfirmConfig.BACKUP_QUEUE_NAME)
    public void receiveBackUp(Message message){
        String msg = new String(message.getBody());
        log.info("备份不可路由消息：{}", msg);
    }
}
